package cn.ecut.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @Author ruanxin
 */

//自定义注解
public class Test01 {
    @MyAnnotation01(name = "sb", age = 16, id = 8, schools = {"东华理工大学", "江西财经大学"})
    public void test() {
    }

}

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation01 {
    //注解的参数:参数类型+参数名()
    String name() default "";

    int age() default 18;

    int id() default -1;//如果默认值为-1 ,代表不存在。

    String[] schools();
}

